package com.link2room.ironhide.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by sss on 2016/10/25.
 */
@Entity
@Table(name = "l2r_group_brand")
@DynamicInsert
public class L2RGroupBrand extends BaseEntity{
    public enum L2RGroupBand_{
        brandCode,brandName,brandNameEn
    }
    private String brandCode;
    private String brandName;
    private String brandNameEn;

    @Basic
    @Column(name = "brand_code", nullable = true, length = 16)
    public String getBrandCode() {
        return brandCode;
    }

    public void setBrandCode(String brandCode) {
        this.brandCode = brandCode;
    }

    @Basic
    @Column(name = "brand_name", nullable = true, length = 16)
    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    @Basic
    @Column(name = "brand_name_en", nullable = true, length = 32)
    public String getBrandNameEn() {
        return brandNameEn;
    }

    public void setBrandNameEn(String brandNameEn) {
        this.brandNameEn = brandNameEn;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        L2RGroupBrand that = (L2RGroupBrand) o;

        if (brandCode != null ? !brandCode.equals(that.brandCode) : that.brandCode != null) return false;
        if (brandName != null ? !brandName.equals(that.brandName) : that.brandName != null) return false;
        if (brandNameEn != null ? !brandNameEn.equals(that.brandNameEn) : that.brandNameEn != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = brandCode != null ? brandCode.hashCode() : 0;
        result = 31 * result + (brandName != null ? brandName.hashCode() : 0);
        result = 31 * result + (brandNameEn != null ? brandNameEn.hashCode() : 0);
        return result;
    }
}
